/*
 * ------------------------------------------------------------------------------------------------------
 *                               通过mqtt消息控制红外发射器    
 *                             目前支持格力空调制热26度以及关闭（可扩展）
 * 订阅iot/ir_in主题获取控制信息。当接收的信息为“G_H_26”时，发送格力空调制热26度的红外信号。
 * 当信息为“G_P_OFF”时，发送关闭格力空调的信号。
 * 发送信号之后的状态会发布到iot/ir_out主题。
 * ------------------------------------------------------------------------------------------------------
*/

/*
G_H_26(Gree Hot 26Degree)
G_P_OFF(Gree Power OFF)
*/
#include <ESP8266WiFi.h>
#include <PubSubClient.h>
#ifndef UNIT_TEST
#include <Arduino.h>
#endif
#include <IRremoteESP8266.h>
#include <IRsend.h>
#define IR_LED 4
IRsend irsend(IR_LED);
//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
uint16_t G_H_16[279] = {8994, 4510,  628, 578,  628, 578,  628, 1680,  628, 1680,  630, 576,  628, 578,  628, 580,  626, 578,  626, 578,  628, 578,  628, 580,  624, 578,  628, 578,  628, 578,  630, 576,  628, 578,  626, 578,  628, 580,  624, 578,  626, 578,  628, 578,  630, 1676,  628, 578,  628, 576,  628, 578,  628, 578,  630, 576,  628, 578,  628, 1680,  630, 574,  628, 1680,  630, 574,  628, 580,  626, 1680,  630, 576,  628, 20010,  628, 578,  626, 578,  626, 578,  628, 578,  626, 578,  630, 576,  628, 578,  628, 580,  626, 580,  624, 578,  628, 578,  626, 578,  628, 578,  628, 1682,  624, 578,  626, 580,  626, 576,  628, 578,  628, 576,  628, 578,  628, 578,  630, 576,  628, 578,  628, 578,  628, 578,  626, 578,  628, 580,  626, 580,  626, 580,  626, 578,  628, 576,  628, 1682,  624, 39996,  8992, 4512,  628, 578,  628, 578,  628, 1682,  626, 1680,  628, 580,  624, 578,  626, 578,  626, 580,  630, 576,  626, 578,  628, 580,  624, 578,  626, 578,  628, 578,  626, 578,  630, 576,  626, 578,  628, 580,  626, 578,  628, 580,  626, 578,  626, 1682,  626, 578,  626, 578,  626, 578,  630, 576,  626, 578,  628, 580,  626, 1680,  628, 1680,  626, 1680,  628, 578,  628, 578,  630, 1674,  628, 580,  626, 20010,  630, 578,  628, 580,  624, 586,  620, 578,  626, 578,  630, 576,  626, 578,  628, 580,  624, 578,  628, 578,  628, 578,  628, 578,  626, 578,  630, 576,  628, 578,  628, 580,  626, 578,  628, 578,  626, 580,  626, 578,  630, 576,  628, 578,  626, 578,  628, 578,  628, 578,  628, 578,  628, 578,  626, 578,  628, 578,  628, 1680,  628, 1680,  630, 576,  628};
uint16_t G_H_17[279] = {9014, 4512,  628, 578,  628, 580,  624, 1680,  626, 1680,  628, 578,  628, 578,  628, 578,  628, 578,  626, 1680,  628, 578,  630, 574,  628, 578,  626, 578,  628, 578,  628, 580,  624, 578,  628, 578,  626, 578,  628, 578,  628, 578,  628, 576,  628, 1680,  630, 576,  628, 578,  628, 578,  628, 578,  628, 578,  626, 578,  628, 1682,  624, 578,  628, 1682,  626, 580,  624, 578,  628, 1682,  626, 580,  626, 20010,  628, 578,  626, 578,  628, 580,  624, 578,  628, 578,  628, 578,  628, 578,  628, 578,  628, 578,  628, 576,  628, 578,  626, 578,  628, 576,  628, 1680,  628, 576,  628, 578,  628, 578,  628, 578,  628, 578,  628, 578,  628, 578,  630, 574,  628, 578,  628, 580,  624, 578,  626, 578,  628, 576,  628, 578,  628, 1678,  628, 578,  628, 578,  628, 1678,  630, 39994,  8992, 4510,  630, 576,  628, 578,  628, 1680,  628, 1678,  630, 574,  628, 578,  628, 580,  626, 578,  628, 1680,  624, 578,  628, 578,  628, 578,  628, 578,  628, 578,  628, 578,  628, 578,  628, 578,  628, 578,  628, 578,  628, 578,  628, 578,  626, 1680,  628, 578,  628, 578,  628, 578,  628, 578,  628, 578,  628, 578,  628, 1678,  628, 1678,  628, 1680,  628, 578,  628, 578,  628, 1678,  628, 578,  628, 20010,  632, 574,  602, 630,  628, 578,  628, 578,  628, 578,  626, 578,  628, 578,  628, 578,  626, 578,  628, 578,  628, 576,  628, 578,  628, 578,  628, 578,  628, 578,  628, 578,  626, 578,  628, 578,  628, 580,  626, 576,  630, 576,  628, 578,  628, 578,  628, 578,  628, 578,  628, 578,  628, 578,  652, 552,  628, 1682,  626, 1680,  628, 1678,  628, 578,  628};
uint16_t G_H_18[279] = {8994, 4510,  632, 576,  628, 578,  628, 1678,  628, 1680,  632, 574,  628, 578,  628, 580,  624, 578,  628, 578,  626, 1680,  628, 578,  628, 578,  626, 578,  632, 574,  628, 578,  656, 576,  628, 578,  628, 580,  624, 578,  628, 578,  628, 578,  626, 1680,  654, 552,  626, 580,  626, 578,  628, 580,  650, 552,  628, 578,  626, 1682,  624, 578,  626, 1682,  626, 576,  628, 578,  628, 1680,  626, 580,  626, 20012,  626, 580,  626, 580,  624, 578,  628, 578,  628, 578,  628, 578,  628, 578,  628, 578,  630, 576,  628, 578,  628, 580,  624, 578,  628, 578,  628, 1682,  624, 578,  628, 578,  628, 578,  626, 578,  628, 578,  630, 576,  626, 578,  626, 580,  626, 578,  628, 578,  628, 580,  628, 578,  628, 578,  628, 578,  630, 576,  628, 1680,  630, 576,  628, 1678,  630, 39994,  8994, 4510,  628, 578,  628, 580,  652, 1654,  628, 1680,  628, 578,  628, 580,  626, 578,  628, 578,  626, 578,  628, 1682,  624, 578,  628, 578,  626, 578,  630, 576,  628, 578,  628, 580,  624, 578,  628, 578,  628, 578,  628, 578,  630, 576,  628, 1678,  632, 576,  626, 578,  626, 580,  626, 578,  628, 576,  628, 578,  626, 1680,  628, 1682,  624, 1680,  628, 580,  624, 578,  628, 1682,  624, 578,  628, 19990,  648, 580,  624, 578,  628, 580,  624, 578,  628, 578,  628, 578,  628, 578,  628, 578,  626, 578,  628, 578,  630, 576,  626, 578,  628, 580,  626, 580,  626, 580,  626, 580,  626, 580,  626, 578,  628, 580,  626, 578,  626, 580,  626, 578,  628, 578,  628, 578,  628, 578,  626, 578,  626, 578,  626, 578,  628, 578,  628, 578,  628, 576,  626, 1680,  628};
uint16_t G_H_19[279] = {8992, 4510,  628, 580,  626, 578,  628, 1680,  630, 1678,  626, 578,  630, 574,  628, 578,  628, 580,  624, 1680,  626, 1680,  628, 578,  628, 580,  624, 578,  626, 578,  628, 578,  628, 578,  626, 578,  628, 578,  626, 578,  630, 576,  626, 578,  628, 1680,  630, 576,  628, 578,  628, 578,  628, 578,  626, 578,  628, 580,  626, 1680,  628, 580,  624, 1680,  628, 580,  626, 578,  626, 1680,  626, 580,  624, 20012,  630, 578,  628, 578,  626, 580,  624, 580,  628, 578,  626, 578,  630, 576,  626, 578,  628, 578,  628, 580,  626, 580,  624, 578,  628, 578,  628, 1682,  624, 578,  626, 578,  628, 578,  630, 576,  628, 578,  626, 578,  628, 578,  628, 580,  626, 578,  630, 576,  626, 578,  626, 580,  652, 552,  628, 578,  628, 1680,  628, 1682,  624, 578,  626, 1682,  650, 39974,  8992, 4510,  628, 580,  626, 578,  654, 1652,  628, 1680,  628, 578,  626, 578,  626, 580,  626, 580,  626, 1680,  628, 1680,  628, 578,  628, 580,  624, 578,  628, 578,  626, 578,  630, 576,  628, 578,  628, 580,  624, 578,  628, 578,  628, 578,  626, 1680,  630, 574,  628, 578,  628, 580,  624, 578,  628, 578,  628, 578,  628, 1678,  628, 1682,  624, 1680,  628, 580,  624, 578,  628, 1682,  626, 578,  628, 19988,  650, 580,  626, 578,  628, 578,  626, 578,  628, 578,  626, 578,  628, 578,  626, 578,  628, 578,  628, 578,  628, 578,  626, 580,  624, 578,  628, 578,  628, 578,  626, 578,  630, 576,  628, 578,  628, 580,  626, 578,  628, 576,  628, 578,  626, 578,  630, 574,  628, 578,  626, 580,  626, 578,  628, 580,  624, 1680,  626, 580,  624, 578,  626, 1682,  626}; 
uint16_t G_H_20[279] = {8992, 4512,  628, 578,  630, 574,  628, 1680,  630, 1678,  628, 578,  626, 578,  630, 576,  628, 578,  628, 578,  628, 580,  626, 1680,  628, 578,  626, 578,  626, 580,  626, 580,  624, 578,  628, 578,  626, 578,  626, 580,  626, 578,  626, 578,  628, 1680,  628, 578,  626, 578,  628, 578,  628, 580,  624, 578,  654, 580,  624, 1680,  626, 580,  626, 1678,  628, 580,  626, 580,  626, 1680,  626, 580,  626, 20008,  632, 576,  628, 578,  628, 580,  624, 578,  628, 580,  626, 578,  628, 578,  628, 578,  630, 576,  626, 578,  628, 580,  624, 578,  628, 578,  628, 1680,  626, 578,  626, 578,  630, 574,  626, 578,  628, 578,  628, 580,  624, 578,  626, 578,  628, 578,  626, 578,  628, 578,  626, 578,  630, 574,  628, 578,  628, 578,  626, 578,  628, 1680,  628, 1678,  626, 40002,  8988, 4512,  628, 578,  628, 580,  624, 1680,  626, 1680,  626, 578,  628, 578,  628, 578,  628, 578,  626, 580,  630, 576,  628, 1680,  630, 576,  626, 578,  626, 580,  624, 578,  628, 578,  628, 578,  630, 576,  628, 578,  628, 580,  624, 578,  626, 1682,  624, 578,  628, 578,  626, 578,  628, 578,  628, 578,  626, 580,  630, 1676,  628, 1682,  624, 1680,  628, 580,  624, 578,  628, 1680,  624, 578,  628, 19994,  646, 578,  628, 578,  628, 578,  628, 576,  628, 578,  626, 580,  626, 580,  624, 578,  628, 578,  628, 578,  626, 578,  626, 580,  626, 578,  628, 578,  628, 578,  628, 578,  630, 576,  628, 578,  626, 578,  626, 580,  626, 578,  628, 580,  624, 578,  626, 578,  628, 578,  628, 578,  630, 574,  628, 576,  628, 580,  626, 1680,  632, 574,  626, 1680,  630};
uint16_t G_H_21[279] = {8992, 4512,  628, 578,  626, 578,  626, 1680,  628, 1682,  626, 580,  624, 578,  628, 578,  628, 578,  628, 1682,  624, 578,  628, 1682,  626, 580,  624, 578,  628, 578,  628, 578,  628, 578,  626, 578,  626, 578,  634, 572,  626, 578,  628, 578,  628, 1680,  628, 578,  628, 580,  624, 578,  626, 578,  628, 578,  626, 578,  628, 1682,  624, 578,  626, 1682,  624, 578,  628, 578,  628, 1680,  628, 578,  626, 20010,  628, 578,  628, 578,  628, 578,  628, 578,  628, 578,  626, 578,  626, 578,  628, 578,  628, 578,  628, 578,  628, 578,  628, 578,  628, 578,  628, 1682,  624, 578,  628, 578,  626, 578,  628, 578,  628, 578,  628, 578,  626, 578,  630, 576,  626, 578,  628, 578,  628, 576,  628, 580,  626, 580,  624, 578,  628, 1680,  626, 580,  626, 1680,  628, 1678,  628, 40022,  8970, 4510,  628, 576,  628, 578,  626, 1678,  628, 1682,  624, 580,  626, 578,  628, 578,  628, 578,  628, 1682,  626, 580,  626, 1680,  628, 578,  628, 576,  628, 580,  624, 578,  628, 578,  628, 578,  628, 578,  628, 578,  628, 578,  628, 578,  628, 1682,  624, 578,  626, 580,  624, 578,  628, 576,  628, 578,  628, 578,  628, 1682,  626, 1680,  628, 1680,  628, 576,  628, 580,  624, 1680,  628, 580,  626, 20012,  626, 580,  626, 578,  626, 578,  626, 578,  630, 574,  628, 578,  628, 580,  624, 578,  628, 580,  624, 578,  628, 578,  628, 578,  628, 578,  626, 578,  630, 574,  628, 578,  628, 580,  624, 578,  628, 578,  626, 578,  630, 574,  628, 578,  628, 580,  624, 578,  626, 580,  626, 578,  630, 574,  628, 578,  628, 1680,  628, 1682,  626, 580,  626, 1680,  632};
uint16_t G_H_22[279] = {8992, 4510,  628, 578,  628, 580,  624, 1680,  628, 1680,  630, 576,  628, 578,  628, 580,  624, 578,  628, 578,  628, 1678,  630, 1676,  628, 578,  628, 578,  628, 578,  628, 578,  628, 578,  628, 578,  628, 578,  628, 578,  628, 576,  628, 580,  626, 1682,  624, 578,  628, 578,  628, 578,  628, 578,  628, 580,  624, 578,  628, 1680,  626, 580,  624, 1680,  628, 580,  626, 576,  628, 1680,  626, 580,  624, 20014,  628, 576,  630, 576,  628, 576,  630, 576,  630, 576,  628, 576,  628, 576,  630, 576,  630, 576,  630, 578,  628, 576,  630, 576,  630, 576,  630, 1680,  628, 576,  630, 576,  628, 574,  630, 574,  630, 576,  632, 572,  630, 576,  628, 576,  630, 574,  630, 576,  630, 576,  630, 578,  628, 576,  632, 574,  630, 576,  628, 1676,  630, 1676,  632, 1676,  630, 39994,  8992, 4512,  626, 580,  624, 578,  628, 1682,  626, 1680,  628, 580,  624, 578,  626, 578,  628, 578,  628, 578,  628, 1682,  624, 1680,  626, 578,  628, 578,  628, 578,  628, 578,  630, 574,  628, 578,  628, 580,  624, 578,  628, 578,  628, 578,  630, 1676,  628, 578,  630, 576,  628, 578,  628, 580,  624, 578,  628, 578,  628, 1680,  626, 1680,  626, 1682,  626, 578,  626, 578,  626, 1682,  624, 578,  626, 19988,  650, 578,  628, 578,  628, 580,  626, 578,  630, 576,  628, 578,  626, 580,  626, 580,  626, 578,  626, 578,  628, 578,  628, 578,  628, 578,  626, 578,  630, 576,  626, 578,  628, 578,  628, 580,  626, 580,  626, 578,  628, 578,  628, 580,  626, 578,  628, 578,  626, 578,  628, 578,  628, 578,  626, 578,  630, 574,  628, 578,  628, 1680,  628, 1680,  630};
uint16_t G_H_23[279] = {8994, 4510,  632, 574,  628, 578,  626, 1680,  628, 1680,  630, 576,  628, 578,  628, 580,  624, 578,  628, 1682,  626, 1680,  628, 1680,  626, 578,  628, 580,  624, 578,  626, 578,  628, 578,  628, 578,  628, 578,  628, 578,  630, 576,  628, 578,  628, 1680,  628, 578,  628, 578,  628, 580,  626, 578,  628, 578,  628, 578,  626, 1680,  628, 578,  628, 1682,  624, 578,  628, 580,  626, 1678,  628, 578,  628, 20008,  628, 578,  628, 580,  624, 578,  628, 578,  628, 578,  630, 576,  628, 578,  628, 580,  624, 578,  628, 578,  628, 578,  628, 578,  626, 580,  624, 1680,  628, 580,  624, 578,  628, 578,  628, 578,  626, 578,  628, 578,  630, 576,  626, 578,  628, 578,  628, 578,  628, 578,  630, 574,  628, 578,  628, 580,  624, 1680,  628, 1678,  628, 1678,  630, 1676,  628, 39994,  8994, 4508,  628, 578,  628, 580,  628, 1678,  628, 1682,  624, 578,  628, 578,  626, 578,  628, 578,  628, 1680,  628, 1682,  624, 1680,  626, 580,  624, 578,  626, 578,  626, 578,  626, 578,  628, 576,  628, 578,  628, 576,  628, 578,  628, 578,  628, 1682,  624, 578,  628, 576,  628, 578,  626, 578,  630, 576,  628, 578,  628, 1680,  628, 1680,  628, 1678,  628, 578,  630, 574,  628, 1680,  630, 576,  628, 20010,  632, 574,  626, 578,  628, 580,  624, 578,  628, 580,  626, 578,  628, 578,  626, 578,  628, 578,  628, 578,  628, 578,  628, 578,  628, 578,  628, 576,  630, 576,  630, 576,  630, 576,  630, 578,  630, 576,  630, 576,  630, 576,  628, 576,  630, 576,  628, 578,  628, 580,  652, 548,  654, 552,  628, 576,  630, 1678,  628, 578,  630, 1680,  628, 1678,  628};
uint16_t G_H_24[279] = {9018, 4510,  628, 578,  628, 578,  626, 1680,  628, 1682,  624, 578,  628, 578,  626, 578,  630, 574,  628, 578,  626, 578,  630, 576,  626, 1678,  632, 574,  626, 578,  628, 580,  624, 578,  628, 578,  628, 578,  630, 576,  628, 578,  628, 580,  624, 1680,  626, 578,  628, 578,  628, 580,  626, 580,  624, 578,  628, 578,  628, 1680,  628, 578,  628, 1680,  628, 580,  626, 578,  628, 1680,  626, 578,  628, 20010,  632, 574,  628, 578,  626, 580,  624, 578,  628, 578,  628, 578,  628, 578,  628, 578,  626, 578,  630, 576,  628, 578,  628, 580,  626, 578,  626, 1680,  626, 578,  626, 580,  626, 578,  628, 578,  628, 578,  630, 576,  628, 578,  628, 580,  624, 578,  654, 580,  626, 578,  628, 578,  628, 578,  628, 578,  630, 576,  628, 578,  628, 580,  626, 578,  626, 40000,  8994, 4506,  628, 578,  628, 578,  628, 1682,  624, 1680,  628, 580,  624, 578,  626, 580,  628, 578,  628, 578,  628, 578,  628, 576,  628, 1680,  630, 576,  628, 578,  628, 580,  626, 580,  626, 578,  628, 578,  626, 578,  626, 580,  630, 574,  628, 1680,  630, 576,  626, 578,  628, 580,  624, 578,  628, 578,  628, 578,  628, 1680,  628, 1682,  624, 1680,  628, 580,  624, 578,  626, 1680,  626, 578,  628, 20010,  628, 580,  626, 580,  626, 580,  626, 580,  626, 580,  626, 578,  626, 578,  630, 576,  626, 578,  628, 578,  630, 576,  626, 578,  628, 578,  628, 580,  626, 580,  626, 578,  628, 578,  628, 580,  626, 578,  626, 578,  630, 576,  628, 578,  626, 580,  626, 578,  628, 578,  626, 578,  630, 574,  628, 580,  626, 578,  626, 1680,  628, 1680,  630, 1676,  628};
uint16_t G_H_25[279] = {8994, 4510,  630, 576,  630, 576,  630, 1680,  628, 1676,  628, 576,  630, 576,  630, 576,  630, 574,  630, 1678,  630, 576,  630, 576,  630, 1678,  630, 576,  630, 576,  630, 576,  656, 550,  630, 576,  632, 574,  630, 576,  628, 576,  630, 576,  628, 1678,  632, 574,  632, 572,  630, 576,  628, 580,  626, 574,  630, 576,  630, 1678,  628, 576,  630, 1678,  628, 580,  626, 576,  628, 1680,  628, 576,  630, 20010,  630, 576,  630, 576,  630, 576,  630, 576,  630, 576,  630, 576,  630, 576,  654, 550,  630, 576,  628, 576,  628, 576,  628, 576,  630, 576,  654, 1652,  630, 576,  656, 550,  630, 574,  628, 578,  628, 576,  630, 576,  630, 576,  630, 576,  630, 576,  630, 576,  628, 576,  628, 578,  628, 576,  630, 576,  628, 1678,  632, 574,  628, 578,  654, 554,  624, 40000,  9018, 4480,  628, 576,  630, 580,  626, 1680,  626, 1678,  632, 574,  628, 576,  630, 576,  654, 552,  630, 1680,  626, 576,  632, 574,  654, 1652,  632, 574,  628, 576,  628, 576,  654, 552,  630, 574,  632, 574,  630, 576,  628, 576,  630, 576,  630, 1676,  630, 576,  656, 550,  630, 576,  632, 572,  630, 574,  630, 576,  630, 1678,  630, 1678,  632, 1674,  630, 576,  628, 578,  628, 1680,  628, 576,  628, 19986,  652, 576,  628, 580,  626, 576,  656, 550,  628, 576,  628, 578,  630, 576,  630, 576,  654, 550,  630, 574,  632, 574,  632, 574,  628, 576,  628, 580,  626, 576,  630, 580,  624, 578,  628, 576,  628, 578,  656, 550,  630, 576,  630, 576,  654, 554,  626, 580,  652, 550,  654, 552,  628, 576,  628, 576,  630, 1682,  626, 1678,  632, 1674,  630, 1676,  630};
uint16_t G_H_26[279] = {9042, 4484,  630, 574,  632, 574,  630, 1676,  632, 1676,  630, 576,  630, 576,  628, 576,  656, 548,  630, 576,  628, 1680,  628, 576,  654, 1652,  632, 574,  630, 576,  628, 576,  630, 576,  630, 576,  656, 550,  630, 576,  632, 572,  684, 526,  626, 1676,  630, 576,  630, 576,  628, 578,  628, 576,  630, 578,  628, 576,  630, 1680,  628, 576,  628, 1680,  626, 576,  628, 576,  630, 1678,  628, 578,  628, 20008,  630, 576,  630, 576,  628, 576,  630, 576,  630, 576,  630, 576,  630, 576,  656, 550,  630, 576,  632, 574,  632, 574,  628, 576,  630, 576,  630, 1678,  630, 574,  632, 574,  630, 576,  654, 554,  626, 580,  626, 576,  630, 576,  630, 576,  630, 576,  630, 576,  630, 576,  628, 576,  630, 576,  630, 576,  630, 576,  654, 1652,  630, 576,  630, 576,  628, 40000,  9016, 4484,  630, 576,  654, 550,  630, 1678,  630, 1678,  628, 580,  626, 576,  628, 576,  630, 576,  630, 576,  654, 1652,  630, 576,  656, 1652,  628, 580,  626, 576,  630, 576,  632, 574,  632, 572,  630, 576,  630, 578,  652, 554,  626, 580,  626, 1678,  632, 572,  630, 576,  630, 576,  630, 576,  630, 576,  630, 576,  628, 1680,  626, 1678,  632, 1674,  628, 578,  630, 576,  628, 1682,  624, 576,  628, 20008,  656, 552,  630, 576,  630, 576,  628, 576,  630, 576,  630, 576,  630, 576,  654, 550,  656, 552,  630, 574,  632, 572,  638, 568,  656, 550,  628, 576,  628, 576,  630, 576,  628, 576,  630, 576,  630, 576,  628, 580,  626, 576,  630, 576,  628, 578,  628, 576,  628, 576,  630, 576,  630, 576,  628, 576,  628, 576,  628, 578,  630, 576,  630, 576,  630};
uint16_t G_H_27[279] = {8996, 4484,  654, 552,  630, 576,  630, 1678,  654, 1654,  628, 580,  652, 552,  628, 576,  656, 550,  628, 1678,  628, 1678,  656, 550,  630, 1678,  632, 574,  632, 574,  628, 576,  632, 574,  632, 574,  628, 578,  654, 554,  626, 580,  626, 576,  630, 1680,  626, 580,  626, 576,  632, 574,  628, 578,  628, 578,  628, 580,  626, 1678,  628, 578,  628, 1678,  630, 576,  654, 550,  630, 1678,  632, 574,  632, 20004,  632, 574,  654, 550,  630, 576,  630, 576,  628, 578,  628, 576,  628, 576,  654, 552,  656, 550,  632, 574,  632, 574,  632, 574,  628, 576,  628, 1678,  628, 578,  628, 578,  628, 580,  626, 576,  628, 578,  628, 576,  628, 576,  628, 578,  628, 576,  630, 576,  630, 576,  628, 578,  628, 578,  628, 576,  630, 1678,  628, 1676,  632, 574,  628, 576,  628, 39996,  9020, 4482,  628, 578,  628, 576,  628, 1680,  626, 1678,  654, 550,  654, 554,  626, 576,  628, 578,  628, 1682,  626, 1678,  632, 574,  628, 1678,  632, 574,  632, 574,  628, 576,  630, 576,  628, 580,  626, 576,  628, 578,  628, 578,  628, 578,  628, 1678,  628, 576,  656, 548,  630, 576,  632, 572,  628, 580,  624, 578,  628, 1678,  628, 1678,  630, 1678,  628, 576,  654, 552,  628, 1678,  628, 578,  628, 20010,  632, 574,  632, 574,  628, 578,  630, 576,  628, 580,  626, 580,  652, 550,  634, 570,  628, 578,  630, 576,  628, 576,  628, 578,  630, 576,  628, 578,  628, 580,  626, 580,  652, 550,  628, 578,  654, 550,  630, 576,  632, 572,  628, 580,  624, 578,  628, 576,  628, 578,  628, 576,  628, 576,  630, 576,  628, 1682,  626, 580,  624, 578,  628, 576,  628};
uint16_t G_H_28[279] = {9020, 4482,  634, 574,  628, 576,  628, 1678,  630, 1678,  632, 574,  628, 578,  628, 576,  628, 576,  630, 576,  628, 576,  628, 1678,  630, 1680,  628, 576,  630, 576,  628, 576,  630, 576,  630, 576,  628, 578,  628, 578,  626, 578,  632, 572,  628, 1678,  656, 550,  628, 576,  656, 550,  628, 576,  630, 576,  628, 578,  630, 1676,  628, 578,  656, 1650,  632, 572,  630, 576,  654, 1654,  656, 550,  630, 20006,  630, 578,  628, 580,  626, 578,  628, 576,  630, 576,  628, 578,  628, 576,  630, 576,  628, 578,  628, 576,  628, 578,  630, 576,  628, 578,  630, 1676,  656, 550,  630, 576,  628, 576,  656, 550,  630, 576,  632, 574,  660, 550,  626, 580,  626, 576,  628, 578,  628, 578,  628, 576,  628, 576,  628, 576,  630, 576,  628, 578,  654, 1652,  630, 576,  656, 39974,  8990, 4510,  632, 574,  632, 572,  628, 1678,  630, 1676,  628, 580,  652, 550,  654, 552,  654, 552,  628, 576,  656, 550,  630, 1676,  628, 1680,  626, 580,  626, 576,  628, 578,  628, 576,  630, 576,  630, 576,  628, 578,  628, 576,  650, 556,  630, 1678,  656, 554,  626, 580,  624, 578,  630, 576,  630, 576,  628, 578,  628, 1678,  628, 1682,  626, 1678,  632, 572,  628, 580,  626, 1680,  628, 576,  654, 19982,  632, 574,  632, 572,  654, 554,  628, 574,  630, 576,  628, 576,  630, 576,  630, 576,  630, 576,  630, 580,  626, 576,  628, 576,  654, 550,  630, 576,  632, 574,  628, 576,  654, 554,  624, 578,  628, 576,  630, 576,  630, 576,  630, 576,  630, 576,  628, 578,  628, 578,  628, 578,  630, 576,  630, 576,  630, 576,  630, 1678,  626, 580,  626, 580,  626};
uint16_t G_H_29[279] = {8992, 4510,  628, 578,  628, 578,  628, 1678,  630, 1680,  628, 576,  628, 578,  628, 576,  630, 576,  630, 1680,  626, 580,  626, 1678,  654, 1652,  632, 572,  628, 578,  628, 580,  626, 578,  628, 578,  628, 578,  628, 578,  630, 576,  628, 576,  654, 1652,  628, 576,  628, 576,  654, 552,  630, 576,  628, 578,  628, 580,  626, 1680,  628, 576,  628, 1678,  632, 574,  628, 578,  628, 1678,  632, 574,  628, 20010,  630, 576,  628, 576,  628, 578,  630, 576,  628, 576,  630, 576,  628, 578,  628, 578,  628, 578,  628, 576,  656, 550,  654, 552,  628, 576,  628, 1678,  630, 580,  626, 580,  626, 576,  628, 576,  628, 578,  628, 576,  628, 578,  628, 576,  654, 552,  628, 576,  628, 578,  628, 576,  654, 554,  626, 580,  624, 1680,  628, 580,  624, 1680,  626, 580,  626, 40020,  8970, 4512,  624, 576,  628, 578,  628, 1682,  624, 1680,  626, 580,  626, 576,  628, 576,  656, 552,  628, 1676,  652, 554,  628, 1680,  626, 1680,  628, 576,  630, 578,  628, 578,  654, 550,  628, 580,  652, 550,  628, 578,  628, 578,  628, 578,  628, 1678,  630, 576,  628, 576,  630, 576,  628, 578,  628, 576,  654, 550,  630, 1678,  628, 1682,  624, 1680,  628, 580,  626, 580,  626, 1678,  628, 576,  628, 20010,  656, 550,  628, 580,  624, 578,  630, 576,  656, 550,  632, 574,  628, 578,  628, 580,  624, 578,  628, 576,  654, 552,  630, 574,  656, 550,  628, 578,  628, 578,  628, 580,  624, 578,  628, 576,  654, 552,  630, 574,  628, 578,  628, 576,  628, 578,  628, 578,  632, 574,  632, 574,  654, 554,  624, 576,  628, 1682,  624, 1682,  626, 576,  628, 578,  628};
uint16_t G_H_30[279] = {9016, 4486,  628, 580,  624, 578,  628, 1682,  624, 1680,  626, 580,  626, 578,  628, 578,  628, 580,  626, 578,  628, 1682,  624, 1680,  628, 1680,  628, 578,  628, 578,  628, 580,  624, 578,  628, 578,  628, 578,  628, 578,  628, 578,  626, 578,  632, 1676,  628, 578,  628, 576,  628, 578,  654, 550,  628, 576,  628, 578,  628, 1678,  628, 580,  626, 1678,  628, 580,  626, 580,  626, 1680,  638, 572,  624, 20008,  632, 574,  628, 578,  628, 576,  628, 580,  624, 578,  628, 578,  628, 576,  628, 578,  628, 578,  654, 552,  628, 578,  628, 578,  628, 580,  626, 1680,  628, 580,  624, 578,  628, 578,  628, 578,  628, 578,  628, 576,  628, 578,  628, 578,  628, 578,  628, 578,  628, 578,  630, 574,  628, 578,  628, 580,  626, 576,  628, 1678,  656, 1652,  630, 574,  628, 40020,  8970, 4510,  632, 574,  632, 574,  628, 1678,  630, 1678,  628, 576,  628, 576,  628, 576,  630, 576,  628, 576,  628, 1682,  624, 1678,  628, 1678,  628, 578,  654, 554,  626, 578,  628, 576,  628, 578,  628, 578,  626, 578,  630, 574,  632, 572,  654, 1652,  628, 578,  628, 578,  628, 580,  624, 578,  654, 552,  628, 576,  628, 1678,  632, 1674,  630, 1676,  628, 578,  628, 578,  654, 1654,  628, 576,  628, 20014,  628, 580,  624, 576,  628, 578,  628, 576,  628, 578,  656, 550,  630, 576,  628, 578,  628, 576,  628, 580,  626, 578,  628, 578,  652, 554,  628, 578,  630, 574,  628, 576,  630, 578,  626, 580,  626, 576,  654, 552,  628, 576,  654, 552,  630, 574,  632, 574,  628, 580,  626, 576,  628, 578,  628, 576,  628, 578,  628, 578,  628, 1678,  628, 578,  626};
//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
uint16_t G_C_16[279] = {8992, 4510,  630, 1678,  630, 574,  632, 574,  632, 1674,  630, 578,  626, 576,  628, 576,  628, 576,  630, 576,  630, 576,  630, 576,  630, 576,  630, 576,  630, 576,  630, 576,  628, 576,  630, 576,  630, 576,  630, 576,  630, 576,  628, 576,  628, 1678,  630, 576,  630, 576,  630, 576,  630, 576,  654, 552,  630, 576,  632, 1676,  654, 550,  632, 1676,  628, 576,  630, 576,  654, 1652,  630, 576,  630, 20008,  630, 576,  630, 576,  630, 576,  628, 576,  630, 576,  630, 576,  630, 576,  630, 576,  630, 576,  656, 550,  630, 574,  632, 574,  632, 574,  630, 1678,  632, 572,  628, 576,  630, 574,  630, 576,  630, 576,  630, 576,  630, 576,  630, 576,  628, 576,  630, 576,  630, 576,  632, 576,  652, 552,  630, 574,  632, 1676,  630, 576,  630, 1678,  628, 580,  626, 39998,  9022, 4480,  630, 1678,  630, 576,  630, 576,  630, 1678,  628, 578,  630, 576,  630, 576,  630, 576,  630, 576,  638, 568,  630, 576,  634, 574,  628, 576,  656, 550,  628, 578,  628, 576,  630, 576,  654, 550,  628, 576,  630, 576,  630, 574,  630, 1678,  656, 550,  630, 574,  632, 572,  630, 576,  628, 580,  624, 578,  628, 1678,  628, 1676,  630, 1680,  626, 576,  628, 578,  628, 1680,  628, 576,  630, 20006,  630, 576,  654, 552,  630, 576,  628, 576,  630, 576,  634, 570,  630, 576,  632, 572,  628, 578,  628, 576,  630, 576,  628, 576,  628, 576,  630, 576,  628, 576,  630, 576,  630, 574,  630, 576,  630, 576,  654, 552,  628, 576,  628, 576,  654, 550,  656, 550,  630, 574,  632, 574,  628, 576,  630, 576,  630, 1680,  626, 1678,  630, 576,  628, 576,  630};
uint16_t G_C_17[279] = {8994, 4512,  650, 1654,  632, 572,  628, 580,  652, 1654,  654, 554,  624, 578,  656, 550,  628, 578,  654, 1654,  628, 578,  628, 576,  628, 578,  628, 580,  626, 578,  654, 552,  630, 576,  628, 578,  628, 576,  630, 576,  628, 578,  628, 576,  628, 1678,  656, 550,  654, 552,  654, 550,  630, 576,  628, 578,  630, 576,  628, 1682,  624, 578,  628, 1678,  656, 550,  656, 554,  626, 1678,  628, 580,  624, 20010,  632, 574,  632, 572,  630, 578,  628, 580,  624, 578,  654, 552,  628, 576,  628, 578,  628, 578,  628, 576,  628, 576,  654, 550,  630, 576,  654, 1652,  630, 576,  632, 574,  632, 574,  628, 578,  654, 550,  630, 576,  628, 580,  626, 576,  630, 576,  630, 576,  630, 576,  628, 578,  628, 576,  628, 578,  654, 550,  630, 1676,  628, 1678,  630, 576,  628, 39998,  8992, 4508,  632, 1676,  628, 576,  630, 578,  628, 1680,  628, 578,  628, 578,  628, 578,  628, 580,  626, 1678,  628, 578,  628, 578,  654, 554,  626, 578,  628, 578,  628, 578,  626, 578,  628, 578,  628, 578,  628, 578,  628, 580,  626, 580,  626, 1678,  628, 580,  624, 578,  628, 578,  628, 578,  628, 578,  628, 578,  628, 1682,  626, 1680,  628, 1678,  628, 578,  628, 580,  650, 1654,  628, 580,  626, 20014,  626, 580,  624, 578,  628, 576,  628, 578,  628, 578,  628, 578,  628, 578,  654, 552,  630, 576,  628, 578,  652, 552,  628, 580,  626, 576,  628, 578,  654, 552,  628, 578,  628, 578,  628, 578,  628, 578,  628, 578,  628, 578,  654, 552,  628, 578,  626, 578,  630, 576,  628, 578,  628, 578,  628, 578,  628, 578,  628, 578,  628, 1678,  628, 578,  628};
uint16_t G_C_18[279] = {8998, 4486,  626, 1678,  632, 574,  630, 576,  628, 1676,  632, 574,  628, 578,  628, 576,  630, 576,  630, 576,  630, 1678,  630, 576,  628, 576,  630, 576,  628, 576,  630, 576,  628, 576,  630, 576,  630, 576,  656, 550,  654, 552,  630, 576,  632, 1674,  656, 550,  630, 574,  632, 572,  630, 576,  656, 550,  628, 576,  630, 1676,  632, 574,  656, 1652,  632, 572,  628, 576,  630, 1678,  628, 576,  630, 19990,  650, 576,  654, 550,  628, 576,  654, 552,  630, 576,  630, 576,  630, 576,  630, 576,  630, 576,  630, 576,  630, 576,  630, 576,  630, 574,  630, 1682,  626, 576,  632, 574,  632, 574,  632, 572,  630, 576,  628, 576,  628, 576,  630, 576,  630, 576,  630, 576,  630, 576,  630, 576,  630, 576,  630, 576,  628, 1678,  630, 1678,  654, 1652,  632, 574,  630, 39996,  8992, 4510,  630, 1680,  628, 580,  650, 550,  656, 1652,  654, 550,  630, 576,  656, 550,  630, 576,  630, 576,  630, 1678,  630, 576,  630, 574,  630, 576,  632, 574,  628, 576,  656, 550,  656, 550,  630, 574,  632, 574,  632, 572,  630, 576,  630, 1676,  632, 574,  656, 550,  628, 576,  630, 576,  630, 576,  630, 576,  630, 1680,  654, 1650,  656, 1652,  630, 576,  630, 576,  628, 1680,  626, 576,  630, 20008,  632, 576,  630, 574,  630, 576,  656, 550,  630, 574,  632, 574,  630, 576,  630, 576,  628, 576,  628, 576,  654, 550,  630, 574,  656, 550,  630, 576,  628, 576,  628, 576,  630, 576,  630, 576,  630, 576,  634, 572,  654, 554,  626, 576,  654, 554,  626, 576,  628, 576,  630, 576,  630, 576,  630, 576,  630, 1678,  628, 578,  628, 1678,  628, 576,  630};
uint16_t G_C_19[279] = {9018, 4510,  654, 1654,  630, 580,  624, 576,  628, 1678,  630, 576,  630, 576,  628, 576,  630, 576,  628, 1678,  628, 1680,  652, 554,  626, 576,  630, 576,  656, 550,  630, 576,  628, 576,  628, 580,  626, 576,  630, 576,  628, 576,  628, 576,  630, 1678,  628, 576,  630, 576,  630, 578,  628, 576,  630, 576,  630, 576,  628, 1678,  630, 576,  628, 1682,  626, 576,  628, 578,  630, 1678,  628, 576,  630, 20008,  630, 576,  628, 578,  628, 576,  630, 576,  628, 576,  630, 576,  628, 576,  628, 576,  630, 576,  630, 576,  628, 576,  628, 578,  628, 576,  628, 1678,  630, 576,  628, 576,  656, 550,  630, 578,  654, 550,  658, 550,  626, 580,  626, 576,  630, 576,  630, 576,  630, 576,  628, 576,  628, 576,  656, 550,  654, 550,  630, 574,  630, 576,  628, 1676,  630, 39994,  8994, 4510,  632, 1674,  630, 576,  632, 574,  628, 1678,  630, 574,  632, 574,  656, 550,  630, 574,  632, 1674,  630, 1678,  630, 576,  630, 576,  628, 576,  630, 576,  654, 550,  630, 576,  628, 578,  630, 576,  630, 576,  630, 576,  630, 576,  630, 1680,  628, 576,  630, 576,  628, 576,  630, 576,  628, 576,  628, 576,  630, 1678,  630, 1680,  650, 1654,  628, 580,  626, 576,  630, 1678,  628, 576,  630, 20008,  658, 548,  630, 576,  630, 576,  630, 576,  628, 576,  630, 576,  654, 554,  650, 552,  630, 576,  632, 574,  654, 550,  632, 574,  632, 572,  630, 576,  656, 550,  630, 576,  628, 576,  656, 550,  628, 576,  630, 576,  630, 576,  628, 576,  630, 576,  628, 576,  630, 576,  628, 576,  630, 576,  630, 576,  628, 576,  628, 1678,  632, 1676,  630, 576,  632};
uint16_t G_C_20[279] = {9046, 4486,  626, 1678,  656, 552,  628, 576,  628, 1678,  654, 552,  628, 576,  628, 578,  628, 576,  628, 578,  628, 578,  628, 1678,  630, 576,  628, 578,  628, 578,  654, 552,  628, 578,  654, 550,  654, 552,  632, 572,  628, 580,  624, 578,  628, 1682,  626, 576,  628, 580,  626, 578,  628, 578,  628, 576,  628, 578,  628, 1678,  628, 578,  628, 1678,  628, 580,  626, 580,  624, 1680,  652, 554,  626, 20008,  632, 574,  632, 574,  654, 550,  628, 578,  628, 580,  652, 550,  628, 576,  654, 552,  628, 576,  632, 574,  632, 572,  628, 578,  628, 580,  626, 1678,  632, 574,  632, 572,  630, 576,  628, 580,  624, 578,  654, 550,  628, 576,  628, 576,  630, 576,  628, 576,  628, 576,  630, 578,  628, 578,  630, 576,  656, 1654,  628, 580,  626, 576,  654, 1652,  630, 39998,  8992, 4510,  630, 1680,  628, 580,  626, 580,  626, 1678,  654, 554,  626, 580,  626, 576,  628, 578,  656, 550,  628, 576,  630, 1676,  630, 576,  628, 580,  624, 578,  628, 576,  630, 576,  630, 576,  628, 578,  628, 576,  630, 578,  628, 578,  654, 1654,  628, 578,  628, 578,  628, 576,  630, 576,  628, 578,  628, 578,  628, 1678,  630, 1676,  630, 1678,  652, 552,  628, 576,  628, 1678,  628, 576,  628, 20010,  656, 550,  628, 576,  628, 578,  654, 550,  654, 552,  632, 572,  654, 554,  654, 554,  624, 576,  628, 578,  628, 576,  628, 578,  628, 578,  628, 576,  630, 576,  628, 576,  628, 576,  630, 578,  628, 578,  628, 578,  654, 550,  630, 576,  628, 576,  630, 576,  630, 576,  628, 580,  624, 578,  628, 576,  628, 1680,  626, 1680,  628, 1678,  632, 574,  628};
uint16_t G_C_21[279] = {9020, 4482,  632, 1676,  630, 576,  628, 578,  628, 1678,  630, 576,  630, 576,  630, 576,  656, 550,  630, 1678,  630, 576,  630, 1682,  624, 576,  628, 576,  630, 576,  630, 576,  630, 576,  652, 554,  630, 576,  630, 576,  630, 576,  656, 548,  654, 1652,  628, 578,  628, 576,  654, 550,  630, 574,  632, 574,  630, 576,  630, 1678,  658, 548,  632, 1676,  630, 578,  626, 576,  630, 1678,  630, 576,  630, 20008,  630, 576,  656, 550,  630, 576,  630, 574,  630, 576,  632, 572,  630, 576,  628, 576,  630, 574,  630, 576,  628, 576,  630, 576,  630, 576,  630, 1678,  630, 576,  656, 550,  630, 574,  632, 574,  630, 576,  628, 576,  630, 576,  628, 576,  630, 576,  630, 576,  630, 576,  630, 576,  630, 576,  656, 550,  630, 576,  632, 1674,  630, 576,  632, 1674,  630, 39996,  9018, 4484,  630, 1676,  630, 576,  630, 576,  634, 1672,  630, 574,  632, 574,  630, 576,  628, 576,  656, 1652,  628, 576,  630, 1676,  630, 576,  628, 576,  654, 552,  630, 576,  630, 574,  656, 550,  630, 576,  632, 572,  656, 550,  630, 574,  660, 1648,  632, 574,  654, 554,  626, 576,  628, 578,  628, 576,  630, 576,  630, 1676,  656, 1652,  630, 1678,  632, 572,  630, 576,  628, 1678,  632, 574,  632, 20006,  656, 550,  630, 574,  632, 574,  628, 576,  630, 576,  630, 580,  626, 576,  630, 576,  630, 576,  628, 580,  626, 576,  654, 550,  630, 576,  628, 578,  628, 576,  630, 576,  630, 576,  656, 550,  656, 550,  630, 576,  630, 576,  630, 576,  628, 576,  630, 574,  630, 576,  628, 576,  656, 550,  628, 578,  630, 576,  628, 576,  630, 576,  630, 1678,  630};
uint16_t G_C_22[279] = {9000, 4482,  630, 1680,  626, 580,  626, 576,  630, 1680,  628, 576,  630, 576,  656, 552,  628, 576,  630, 576,  654, 1656,  628, 1678,  632, 574,  656, 550,  632, 574,  632, 572,  630, 576,  630, 576,  656, 550,  628, 576,  630, 576,  656, 550,  630, 1676,  630, 576,  630, 576,  630, 576,  628, 578,  654, 552,  654, 550,  630, 1676,  656, 552,  628, 1678,  630, 576,  628, 576,  630, 1678,  630, 576,  628, 20014,  626, 576,  630, 576,  630, 576,  630, 574,  656, 552,  630, 576,  628, 576,  630, 576,  630, 574,  630, 574,  634, 572,  630, 576,  628, 576,  628, 1678,  630, 576,  630, 576,  656, 550,  632, 574,  630, 576,  654, 552,  632, 574,  628, 576,  630, 576,  630, 574,  630, 576,  630, 576,  628, 576,  630, 576,  628, 1678,  628, 1682,  626, 576,  630, 1680,  628, 39994,  9020, 4484,  630, 1678,  632, 572,  656, 554,  650, 1654,  628, 580,  626, 576,  630, 576,  630, 576,  628, 576,  630, 1678,  628, 1680,  626, 576,  628, 576,  628, 578,  628, 576,  630, 576,  630, 576,  628, 576,  630, 576,  628, 576,  656, 550,  630, 1678,  630, 576,  630, 576,  658, 550,  628, 576,  656, 550,  656, 550,  654, 1652,  630, 1676,  630, 1676,  630, 576,  628, 576,  630, 1678,  632, 572,  630, 19988,  652, 580,  626, 576,  628, 576,  630, 576,  630, 576,  630, 576,  630, 576,  630, 576,  628, 578,  628, 576,  630, 576,  654, 552,  654, 550,  656, 550,  632, 574,  656, 550,  632, 572,  630, 576,  630, 580,  626, 576,  630, 576,  628, 576,  630, 576,  630, 576,  630, 576,  630, 576,  630, 576,  630, 576,  630, 1676,  630, 576,  630, 576,  630, 1676,  630};
uint16_t G_C_23[279] = {9018, 4512,  628, 1680,  626, 576,  628, 576,  628, 1680,  628, 580,  652, 552,  628, 578,  628, 578,  628, 1682,  626, 1678,  630, 1676,  628, 578,  652, 552,  630, 576,  654, 550,  652, 554,  626, 580,  626, 576,  628, 576,  628, 576,  630, 576,  628, 1682,  626, 576,  628, 576,  628, 578,  654, 550,  630, 576,  654, 550,  628, 1678,  628, 578,  654, 1652,  656, 550,  628, 578,  628, 1678,  654, 550,  628, 20010,  632, 576,  628, 576,  654, 554,  652, 552,  628, 576,  628, 576,  628, 578,  628, 576,  628, 578,  628, 576,  628, 576,  628, 580,  626, 576,  628, 1680,  654, 554,  624, 578,  628, 576,  628, 576,  628, 576,  628, 578,  628, 578,  654, 550,  630, 576,  628, 578,  628, 578,  628, 576,  628, 580,  624, 578,  628, 578,  628, 578,  628, 1680,  626, 1678,  628, 40000,  9020, 4482,  628, 1680,  654, 552,  632, 574,  628, 1680,  630, 576,  632, 574,  630, 576,  628, 580,  624, 1680,  628, 1682,  628, 1676,  628, 576,  630, 576,  628, 576,  630, 576,  628, 576,  628, 578,  630, 576,  628, 576,  654, 552,  628, 576,  652, 1654,  628, 576,  654, 550,  630, 576,  632, 574,  628, 578,  628, 580,  626, 1678,  632, 1674,  630, 1676,  630, 576,  654, 550,  630, 1678,  628, 576,  654, 19986,  626, 580,  624, 576,  630, 576,  628, 576,  630, 576,  628, 578,  628, 576,  628, 576,  628, 578,  628, 576,  630, 576,  628, 578,  628, 578,  628, 578,  628, 576,  628, 576,  628, 576,  654, 552,  628, 576,  656, 552,  628, 578,  628, 576,  630, 576,  628, 576,  628, 578,  628, 576,  654, 552,  628, 576,  656, 550,  630, 1676,  630, 576,  656, 1650,  630};
uint16_t G_C_24[279] = {9020, 4510,  632, 1674,  630, 576,  628, 576,  630, 1678,  628, 576,  628, 576,  630, 576,  630, 576,  628, 576,  628, 578,  628, 576,  630, 1678,  630, 576,  630, 576,  630, 576,  630, 576,  628, 576,  630, 576,  628, 578,  628, 576,  630, 578,  628, 1686,  622, 576,  630, 576,  630, 580,  626, 580,  624, 578,  630, 576,  630, 1680,  626, 580,  626, 1680,  626, 580,  626, 576,  628, 1680,  628, 580,  624, 20010,  630, 576,  628, 576,  630, 576,  628, 576,  630, 576,  628, 576,  630, 576,  628, 576,  628, 578,  628, 576,  628, 578,  628, 576,  630, 576,  628, 1678,  630, 576,  630, 576,  628, 576,  630, 576,  630, 576,  628, 578,  628, 576,  630, 576,  630, 576,  630, 576,  630, 576,  630, 576,  630, 576,  628, 576,  632, 1674,  630, 576,  630, 1678,  630, 1678,  628, 39996,  8994, 4508,  630, 1678,  630, 576,  628, 576,  630, 1676,  630, 576,  630, 576,  630, 576,  630, 576,  628, 576,  630, 574,  630, 576,  630, 1676,  630, 576,  630, 576,  630, 574,  630, 576,  628, 576,  630, 576,  630, 576,  630, 576,  630, 576,  628, 1678,  628, 576,  630, 576,  630, 576,  630, 576,  630, 576,  630, 576,  658, 1650,  630, 1676,  630, 1676,  630, 580,  626, 576,  630, 1680,  628, 576,  630, 20008,  632, 576,  630, 576,  628, 576,  630, 578,  628, 576,  630, 576,  630, 576,  630, 576,  630, 576,  630, 576,  630, 576,  630, 576,  630, 576,  630, 576,  630, 576,  628, 576,  630, 576,  630, 576,  628, 576,  630, 576,  630, 576,  630, 576,  630, 576,  628, 576,  628, 576,  630, 576,  630, 574,  630, 576,  632, 1676,  630, 1676,  630, 576,  630, 1676,  632};
uint16_t G_C_25[279] = {9014, 4508,  630, 1678,  630, 576,  628, 578,  628, 1678,  630, 576,  630, 576,  630, 576,  628, 576,  630, 1678,  630, 576,  628, 576,  630, 1678,  632, 574,  630, 576,  628, 576,  630, 576,  628, 576,  628, 576,  628, 576,  630, 576,  628, 576,  630, 1678,  630, 576,  628, 576,  630, 576,  630, 576,  630, 576,  630, 576,  628, 1678,  630, 578,  626, 1678,  628, 576,  628, 576,  656, 1652,  654, 554,  626, 19988,  652, 576,  630, 576,  630, 576,  630, 576,  630, 576,  654, 550,  630, 576,  632, 574,  628, 576,  628, 580,  650, 550,  630, 576,  628, 576,  630, 1676,  630, 576,  630, 576,  630, 580,  626, 576,  628, 578,  628, 576,  630, 576,  630, 576,  628, 576,  630, 576,  628, 576,  630, 576,  630, 576,  630, 576,  630, 576,  628, 1678,  630, 1680,  628, 1676,  630, 39998,  9018, 4484,  630, 1678,  630, 576,  630, 576,  628, 1678,  630, 576,  630, 576,  630, 576,  630, 576,  630, 1678,  630, 576,  630, 576,  630, 1678,  656, 550,  630, 576,  628, 576,  656, 550,  628, 576,  630, 576,  630, 576,  630, 576,  628, 576,  628, 1682,  626, 576,  630, 576,  630, 576,  628, 576,  630, 576,  630, 576,  630, 1676,  654, 1654,  628, 1678,  632, 572,  630, 576,  654, 1652,  628, 576,  630, 20008,  632, 574,  630, 576,  628, 578,  630, 576,  628, 576,  630, 576,  630, 576,  630, 576,  630, 576,  630, 576,  654, 550,  630, 576,  630, 576,  656, 550,  630, 576,  632, 572,  630, 576,  628, 576,  630, 576,  630, 576,  630, 576,  630, 576,  630, 576,  630, 576,  628, 576,  630, 574,  630, 576,  632, 572,  656, 554,  652, 550,  628, 1682,  652, 1652,  628};
uint16_t G_C_26[279] = {9044, 4490,  652, 1652,  628, 580,  652, 550,  630, 1680,  654, 550,  630, 576,  630, 576,  628, 576,  656, 552,  628, 1678,  654, 554,  626, 1678,  632, 572,  630, 576,  656, 550,  628, 576,  656, 550,  656, 550,  632, 574,  632, 572,  630, 576,  630, 1676,  630, 576,  628, 576,  630, 576,  654, 550,  630, 576,  628, 576,  630, 1680,  654, 554,  626, 1676,  654, 554,  626, 580,  626, 1678,  628, 578,  630, 20010,  632, 574,  630, 574,  656, 550,  632, 574,  628, 576,  630, 576,  628, 576,  656, 552,  654, 550,  630, 576,  628, 576,  628, 576,  630, 576,  630, 1678,  632, 574,  628, 576,  654, 554,  626, 580,  626, 576,  630, 576,  630, 578,  652, 552,  628, 576,  628, 576,  630, 576,  628, 578,  628, 576,  628, 576,  630, 1678,  628, 1680,  628, 1678,  656, 1650,  630, 39996,  8994, 4510,  632, 1674,  630, 574,  656, 550,  632, 1674,  630, 576,  632, 572,  630, 576,  628, 580,  626, 576,  654, 1652,  628, 580,  626, 1678,  628, 580,  626, 576,  630, 576,  630, 576,  630, 576,  630, 576,  628, 576,  630, 576,  630, 576,  628, 1678,  628, 578,  628, 576,  630, 576,  628, 578,  628, 576,  630, 576,  628, 1678,  628, 1680,  628, 1676,  656, 550,  628, 578,  628, 1678,  630, 576,  630, 20008,  632, 576,  628, 576,  654, 550,  630, 574,  632, 574,  628, 576,  628, 580,  626, 576,  630, 576,  628, 576,  630, 576,  628, 576,  630, 578,  628, 578,  628, 578,  628, 578,  628, 576,  630, 576,  628, 576,  630, 576,  630, 576,  628, 576,  654, 552,  628, 576,  628, 576,  630, 576,  654, 550,  630, 576,  654, 1652,  630, 576,  632, 1676,  656, 1652,  644};
uint16_t G_C_27[279] = {9020, 4506,  632, 1676,  628, 578,  628, 576,  628, 1678,  654, 550,  630, 574,  630, 576,  630, 580,  624, 1680,  628, 1678,  632, 574,  630, 1678,  656, 550,  632, 572,  628, 580,  652, 550,  630, 578,  628, 576,  628, 576,  654, 552,  628, 576,  630, 1678,  630, 576,  628, 578,  628, 576,  628, 580,  626, 578,  628, 578,  628, 1678,  630, 576,  630, 1678,  628, 576,  630, 576,  628, 1678,  628, 576,  656, 19980,  656, 552,  628, 578,  652, 552,  654, 552,  630, 576,  632, 572,  628, 578,  654, 554,  626, 580,  624, 576,  628, 576,  630, 576,  632, 574,  630, 1680,  626, 580,  650, 552,  628, 576,  628, 576,  654, 552,  628, 578,  628, 578,  654, 550,  628, 576,  630, 576,  628, 576,  630, 576,  628, 576,  654, 550,  630, 576,  632, 572,  654, 552,  628, 578,  628, 39992,  8998, 4506,  632, 1674,  630, 576,  632, 574,  630, 1678,  632, 574,  632, 574,  628, 578,  652, 554,  628, 1678,  628, 1678,  630, 576,  632, 1674,  630, 576,  630, 576,  628, 576,  630, 576,  628, 576,  628, 576,  630, 576,  628, 578,  630, 576,  630, 1678,  628, 576,  628, 576,  630, 576,  630, 576,  628, 576,  630, 576,  628, 1678,  656, 1650,  632, 1676,  628, 576,  630, 576,  628, 1678,  628, 576,  630, 19986,  654, 574,  630, 576,  628, 580,  626, 576,  630, 576,  656, 550,  630, 576,  628, 576,  628, 580,  626, 576,  630, 576,  656, 550,  630, 576,  628, 576,  628, 576,  628, 576,  656, 550,  628, 576,  628, 576,  630, 576,  630, 576,  656, 550,  630, 576,  630, 576,  630, 576,  654, 552,  630, 576,  638, 568,  632, 574,  632, 1674,  630, 1678,  654, 1652,  630};
uint16_t G_C_28[279] = {8972, 4510,  630, 1678,  654, 554,  652, 554,  626, 1676,  630, 574,  632, 574,  628, 576,  630, 580,  626, 576,  630, 576,  654, 1652,  628, 1678,  632, 574,  628, 578,  630, 576,  628, 580,  626, 576,  628, 578,  628, 576,  630, 576,  654, 550,  630, 1678,  630, 576,  628, 576,  630, 576,  628, 576,  630, 576,  628, 576,  628, 1682,  626, 576,  628, 1676,  630, 576,  628, 576,  628, 1678,  630, 576,  630, 20008,  630, 576,  630, 576,  630, 576,  628, 578,  630, 576,  628, 576,  630, 576,  628, 576,  628, 578,  630, 576,  628, 576,  630, 576,  634, 572,  632, 1676,  628, 576,  630, 576,  628, 576,  630, 576,  630, 576,  628, 576,  630, 576,  628, 578,  630, 576,  630, 574,  630, 578,  654, 554,  626, 576,  628, 578,  632, 1676,  630, 576,  632, 574,  628, 576,  628, 39994,  8994, 4508,  654, 1654,  628, 580,  626, 576,  652, 1658,  626, 576,  630, 576,  630, 576,  628, 576,  628, 576,  628, 578,  632, 1676,  628, 1678,  630, 578,  654, 550,  630, 576,  654, 550,  656, 550,  632, 574,  632, 574,  630, 576,  630, 580,  626, 1676,  654, 554,  628, 576,  630, 576,  630, 576,  630, 576,  628, 576,  630, 1678,  632, 1676,  628, 1678,  628, 578,  628, 576,  628, 1682,  626, 576,  628, 20006,  630, 576,  628, 576,  630, 576,  630, 576,  628, 576,  656, 550,  630, 576,  632, 572,  628, 576,  630, 576,  628, 576,  630, 576,  654, 550,  630, 576,  630, 574,  632, 574,  628, 576,  628, 576,  630, 580,  652, 550,  628, 578,  632, 572,  628, 576,  630, 576,  630, 576,  630, 576,  630, 576,  628, 578,  628, 1678,  630, 1680,  626, 1678,  654, 1654,  626};
uint16_t G_C_29[279] = {9026, 4482,  654, 1652,  656, 550,  630, 576,  630, 1676,  630, 576,  628, 576,  654, 554,  652, 550,  630, 1678,  628, 576,  630, 1680,  628, 1678,  630, 576,  632, 572,  630, 576,  628, 580,  626, 576,  628, 576,  630, 576,  630, 576,  630, 576,  654, 1652,  630, 576,  654, 550,  628, 578,  630, 576,  628, 576,  630, 576,  628, 1682,  626, 580,  624, 1680,  632, 572,  628, 578,  628, 1678,  654, 550,  632, 19988,  648, 580,  626, 576,  628, 576,  630, 576,  630, 576,  654, 552,  630, 574,  628, 576,  630, 576,  630, 576,  628, 576,  630, 576,  654, 552,  630, 1676,  628, 578,  628, 576,  628, 578,  628, 580,  650, 550,  630, 576,  628, 576,  628, 576,  654, 552,  628, 576,  630, 576,  630, 576,  630, 576,  630, 576,  656, 550,  628, 1678,  628, 576,  628, 578,  628, 40020,  8996, 4484,  644, 1662,  632, 574,  652, 554,  654, 1652,  654, 550,  628, 580,  624, 578,  628, 578,  628, 1678,  628, 578,  628, 1678,  628, 1680,  626, 576,  630, 576,  628, 576,  628, 576,  628, 578,  628, 576,  628, 576,  628, 576,  630, 576,  628, 1678,  628, 576,  654, 552,  628, 576,  628, 576,  656, 550,  628, 576,  632, 1674,  630, 1678,  654, 1652,  630, 574,  628, 578,  630, 1676,  630, 578,  628, 20010,  630, 578,  654, 552,  628, 576,  630, 576,  628, 578,  628, 578,  628, 576,  654, 552,  630, 576,  632, 572,  630, 578,  654, 554,  624, 576,  630, 576,  628, 578,  628, 576,  630, 576,  628, 576,  628, 576,  630, 578,  628, 576,  628, 578,  630, 576,  628, 580,  626, 576,  628, 576,  628, 578,  628, 576,  628, 576,  628, 578,  628, 576,  630, 576,  628};
uint16_t G_C_30[279] = {9018, 4510,  632, 1674,  630, 576,  628, 576,  654, 1652,  632, 572,  628, 578,  628, 578,  628, 580,  626, 576,  628, 1680,  626, 1678,  632, 1674,  630, 576,  632, 572,  630, 576,  628, 578,  628, 576,  628, 580,  626, 576,  628, 576,  628, 578,  628, 1682,  624, 578,  628, 578,  628, 576,  630, 578,  628, 578,  630, 576,  654, 1654,  678, 552,  628, 1680,  626, 580,  626, 578,  654, 1652,  632, 574,  628, 20010,  630, 574,  628, 578,  628, 580,  624, 576,  628, 578,  628, 578,  628, 578,  628, 576,  638, 568,  654, 552,  628, 576,  632, 574,  632, 572,  628, 1678,  632, 574,  632, 572,  630, 576,  628, 580,  624, 576,  656, 550,  632, 574,  628, 578,  654, 554,  626, 580,  626, 576,  628, 578,  628, 576,  628, 576,  630, 1678,  628, 1680,  628, 580,  624, 578,  628, 40020,  8968, 4510,  630, 1678,  656, 550,  628, 576,  656, 1652,  630, 576,  630, 576,  630, 576,  628, 576,  628, 580,  624, 1680,  628, 1678,  628, 1678,  630, 576,  632, 572,  660, 548,  628, 576,  630, 576,  628, 578,  628, 578,  628, 576,  632, 574,  628, 1678,  630, 574,  632, 572,  660, 548,  626, 580,  626, 580,  624, 576,  628, 1680,  626, 1678,  632, 1676,  628, 576,  632, 574,  632, 1674,  630, 576,  632, 20004,  632, 576,  628, 576,  628, 580,  626, 576,  630, 576,  628, 576,  628, 576,  628, 578,  628, 576,  630, 576,  630, 576,  630, 576,  628, 576,  654, 550,  630, 576,  632, 572,  660, 548,  626, 576,  628, 576,  630, 576,  628, 576,  630, 576,  630, 576,  654, 550,  630, 574,  628, 576,  630, 576,  630, 576,  628, 1678,  630, 576,  628, 578,  626, 576,  628};
uint16_t G_P_OFF[279] = {9026, 4480,  660, 544,  660, 546,  658, 1648,  660, 544,  658, 548,  658, 546,  660, 548,  660, 544,  658, 1648,  662, 1646,  660, 546,  658, 1648,  660, 546,  658, 546,  658, 546,  660, 546,  660, 546,  660, 546,  660, 546,  660, 546,  660, 546,  658, 1648,  658, 546,  660, 546,  660, 544,  660, 546,  658, 546,  660, 546,  660, 1650,  656, 548,  658, 1648,  662, 544,  658, 546,  660, 1648,  662, 542,  660, 19976,  660, 546,  660, 546,  660, 546,  658, 546,  658, 546,  660, 546,  660, 546,  660, 546,  660, 546,  660, 546,  658, 546,  660, 546,  660, 546,  660, 1646,  660, 546,  660, 546,  658, 546,  658, 548,  658, 546,  658, 546,  660, 546,  660, 546,  658, 546,  658, 548,  658, 546,  658, 546,  658, 546,  660, 546,  658, 1648,  658, 1648,  660, 546,  660, 1648,  660, 39968,  9018, 4480,  660, 546,  658, 548,  658, 1648,  660, 544,  660, 546,  658, 546,  660, 576,  656, 546,  658, 1648,  660, 1648,  658, 546,  660, 1648,  658, 548,  658, 546,  658, 546,  660, 548,  658, 548,  658, 546,  658, 546,  658, 548,  658, 546,  660, 1652,  654, 548,  658, 546,  660, 546,  658, 546,  660, 546,  660, 546,  658, 1648,  658, 1648,  658, 1648,  660, 546,  660, 546,  658, 1648,  662, 544,  658, 19982,  658, 546,  660, 546,  658, 546,  660, 546,  660, 546,  660, 546,  658, 546,  658, 548,  658, 548,  658, 546,  658, 546,  658, 546,  658, 546,  658, 546,  660, 548,  658, 546,  660, 548,  658, 548,  658, 548,  658, 546,  658, 546,  660, 546,  660, 546,  660, 546,  658, 546,  660, 546,  658, 548,  658, 546,  660, 1648,  662, 544,  658, 548,  658, 1648,  660};  // GREE
const char* ssid = "***********";
const char* password = "***********";
const char* mqtt_server = "***********";

WiFiClient espClient;
PubSubClient client(espClient);
long lastMsg = 0;
char msg[50];
int value = 0;
extern char WhichMode = 'C'; 

void setup_wifi() {
  delay(10);
  Serial.println();
  Serial.print("Connecting to ");
  Serial.println(ssid);
  WiFi.begin(ssid, password);
  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
  }
  randomSeed(micros());
  Serial.println("");
  Serial.println("WiFi connected");
  Serial.println("IP address: ");
  Serial.println(WiFi.localIP());
}

void callback(char* topic, byte* payload, unsigned int length) {
  Serial.print("Message arrived [");
  Serial.print(topic);
  Serial.print("] ");
  String msgIN;
  for (int i = 0; i < length; i++) {
    msgIN += (char)payload[i];
  }
  Serial.print(msgIN);
  Serial.println();
  if (msgIN == "Mode_C") {
    WhichMode = 'C';
    Serial.println("当前模式制冷");
  }
  if (msgIN == "Mode_H") {
    WhichMode = 'H';
    Serial.println("当前模式制热");
  }
//---------------------------------------------------------------------
  if (msgIN == "16"&&WhichMode == 'H') {
#if SEND_RAW
    Serial.println("红外信号发送");
    irsend.sendRaw(G_H_16, 279, 38);
#endif
    Serial.println("当前状态：制热 16度");
    client.publish("iot/ir_out", "制热 16度");
  }
//---------------------------------------------------------------------
//---------------------------------------------------------------------
  if (msgIN == "17"&&WhichMode == 'H') {
#if SEND_RAW
    Serial.println("红外信号发送");
    irsend.sendRaw(G_H_17, 279, 38);
#endif
    Serial.println("当前状态：制热 17度");
    client.publish("iot/ir_out", "制热 17度");
  }
//---------------------------------------------------------------------
//---------------------------------------------------------------------
  if (msgIN == "18"&&WhichMode == 'H') {
#if SEND_RAW
    Serial.println("红外信号发送");
    irsend.sendRaw(G_H_18, 279, 38);
#endif
    Serial.println("当前状态：制热 18度");
    client.publish("iot/ir_out", "制热 18度");
  }
//---------------------------------------------------------------------
//---------------------------------------------------------------------
  if (msgIN == "19"&&WhichMode == 'H') {
#if SEND_RAW
    Serial.println("红外信号发送");
    irsend.sendRaw(G_H_19, 279, 38);
#endif
    Serial.println("当前状态：制热 19度");
    client.publish("iot/ir_out", "制热 19度");
  }
//---------------------------------------------------------------------
//---------------------------------------------------------------------
  if (msgIN == "20"&&WhichMode == 'H') {
#if SEND_RAW
    Serial.println("红外信号发送");
    irsend.sendRaw(G_H_20, 279, 38);
#endif
    Serial.println("当前状态：制热 20度");
    client.publish("iot/ir_out", "制热 20度");
  }
//---------------------------------------------------------------------
//---------------------------------------------------------------------
  if (msgIN == "21"&&WhichMode == 'H') {
#if SEND_RAW
    Serial.println("红外信号发送");
    irsend.sendRaw(G_H_21, 279, 38);
#endif
    Serial.println("当前状态：制热 21度");
    client.publish("iot/ir_out", "制热 21度");
  }
//---------------------------------------------------------------------
//---------------------------------------------------------------------
  if (msgIN == "22"&&WhichMode == 'H') {
#if SEND_RAW
    Serial.println("红外信号发送");
    irsend.sendRaw(G_H_22, 279, 38);
#endif
    Serial.println("当前状态：制热 22度");
    client.publish("iot/ir_out", "制热 22度");
  }
//---------------------------------------------------------------------
//---------------------------------------------------------------------
  if (msgIN == "23"&&WhichMode == 'H') {
#if SEND_RAW
    Serial.println("红外信号发送");
    irsend.sendRaw(G_H_23, 279, 38);
#endif
    Serial.println("当前状态：制热 23度");
    client.publish("iot/ir_out", "制热 23度");
  }
//---------------------------------------------------------------------
//---------------------------------------------------------------------
  if (msgIN == "24"&&WhichMode == 'H') {
#if SEND_RAW
    Serial.println("红外信号发送");
    irsend.sendRaw(G_H_24, 279, 38);
#endif
    Serial.println("当前状态：制热 24度");
    client.publish("iot/ir_out", "制热 24度");
  }
//---------------------------------------------------------------------
//---------------------------------------------------------------------
  if (msgIN == "25"&&WhichMode == 'H') {
#if SEND_RAW
    Serial.println("红外信号发送");
    irsend.sendRaw(G_H_25, 279, 38);
#endif
    Serial.println("当前状态：制热 25度");
    client.publish("iot/ir_out", "制热 25度");
  }
//---------------------------------------------------------------------
//---------------------------------------------------------------------
  if (msgIN == "26"&&WhichMode == 'H') {
#if SEND_RAW
    Serial.println("红外信号发送");
    irsend.sendRaw(G_H_26, 279, 38);
#endif
    Serial.println("当前状态：制热 26度");
    client.publish("iot/ir_out", "制热 26度");
  }
//---------------------------------------------------------------------
//---------------------------------------------------------------------
  if (msgIN == "27"&&WhichMode == 'H') {
#if SEND_RAW
    Serial.println("红外信号发送");
    irsend.sendRaw(G_H_27, 279, 38);
#endif
    Serial.println("当前状态：制热 27度");
    client.publish("iot/ir_out", "制热 27度");
  }
//---------------------------------------------------------------------
//---------------------------------------------------------------------
  if (msgIN == "28"&&WhichMode == 'H') {
#if SEND_RAW
    Serial.println("红外信号发送");
    irsend.sendRaw(G_H_28, 279, 38);
#endif
    Serial.println("当前状态：制热 28度");
    client.publish("iot/ir_out", "制热 28度");
  }
//---------------------------------------------------------------------
//---------------------------------------------------------------------
  if (msgIN == "29"&&WhichMode == 'H') {
#if SEND_RAW
    Serial.println("红外信号发送");
    irsend.sendRaw(G_H_29, 279, 38);
#endif
    Serial.println("当前状态：制热 29度");
    client.publish("iot/ir_out", "制热 29度");
  }
//---------------------------------------------------------------------
//---------------------------------------------------------------------
  if (msgIN == "30"&&WhichMode == 'H') {
#if SEND_RAW
    Serial.println("红外信号发送");
    irsend.sendRaw(G_H_30, 279, 38);
#endif
    Serial.println("当前状态：制热 30度");
    client.publish("iot/ir_out", "制热 30度");
  }
//---------------------------------------------------------------------
//---------------------------------------------------------------------
  if (msgIN == "16"&&WhichMode == 'C') {
#if SEND_RAW
    Serial.println("红外信号发送");
    irsend.sendRaw(G_C_16, 279, 38);
#endif
    Serial.println("当前状态：制冷 16度");
    client.publish("iot/ir_out", "制冷 16度");
  }
//---------------------------------------------------------------------
//---------------------------------------------------------------------
  if (msgIN == "17"&&WhichMode == 'C') {
#if SEND_RAW
    Serial.println("红外信号发送");
    irsend.sendRaw(G_C_17, 279, 38);
#endif
    Serial.println("当前状态：制冷 17度");
    client.publish("iot/ir_out", "制冷 17度");
  }
//---------------------------------------------------------------------
//---------------------------------------------------------------------
  if (msgIN == "18"&&WhichMode == 'C') {
#if SEND_RAW
    Serial.println("红外信号发送");
    irsend.sendRaw(G_C_18, 279, 38);
#endif
    Serial.println("当前状态：制冷 18度");
    client.publish("iot/ir_out", "制冷 18度");
  }
//---------------------------------------------------------------------
//---------------------------------------------------------------------
  if (msgIN == "19"&&WhichMode == 'C') {
#if SEND_RAW
    Serial.println("红外信号发送");
    irsend.sendRaw(G_C_19, 279, 38);
#endif
    Serial.println("当前状态：制冷 19度");
    client.publish("iot/ir_out", "制冷 19度");
  }
//---------------------------------------------------------------------
//---------------------------------------------------------------------
  if (msgIN == "20"&&WhichMode == 'C') {
#if SEND_RAW
    Serial.println("红外信号发送");
    irsend.sendRaw(G_C_20, 279, 38);
#endif
    Serial.println("当前状态：制冷 20度");
    client.publish("iot/ir_out", "制冷 20度");
  }
//---------------------------------------------------------------------
//---------------------------------------------------------------------
  if (msgIN == "21"&&WhichMode == 'C') {
#if SEND_RAW
    Serial.println("红外信号发送");
    irsend.sendRaw(G_C_21, 279, 38);
#endif
    Serial.println("当前状态：制冷 21度");
    client.publish("iot/ir_out", "制冷 21度");
  }
//---------------------------------------------------------------------
//---------------------------------------------------------------------
  if (msgIN == "22"&&WhichMode == 'C') {
#if SEND_RAW
    Serial.println("红外信号发送");
    irsend.sendRaw(G_C_22, 279, 38);
#endif
    Serial.println("当前状态：制冷 22度");
    client.publish("iot/ir_out", "制冷 22度");
  }
//---------------------------------------------------------------------
//---------------------------------------------------------------------
  if (msgIN == "23"&&WhichMode == 'C') {
#if SEND_RAW
    Serial.println("红外信号发送");
    irsend.sendRaw(G_C_23, 279, 38);
#endif
    Serial.println("当前状态：制冷 23度");
    client.publish("iot/ir_out", "制冷 23度");
  }
//---------------------------------------------------------------------
//---------------------------------------------------------------------
  if (msgIN == "24"&&WhichMode == 'C') {
#if SEND_RAW
    Serial.println("红外信号发送");
    irsend.sendRaw(G_C_24, 279, 38);
#endif
    Serial.println("当前状态：制冷 24度");
    client.publish("iot/ir_out", "制冷 24度");
  }
//---------------------------------------------------------------------
//---------------------------------------------------------------------
  if (msgIN == "25"&&WhichMode == 'C') {
#if SEND_RAW
    Serial.println("红外信号发送");
    irsend.sendRaw(G_C_25, 279, 38);
#endif
    Serial.println("当前状态：制冷 25度");
    client.publish("iot/ir_out", "制冷 25度");
  }
//---------------------------------------------------------------------
//---------------------------------------------------------------------
  if (msgIN == "26"&&WhichMode == 'C') {
#if SEND_RAW
    Serial.println("红外信号发送");
    irsend.sendRaw(G_C_26, 279, 38);
#endif
    Serial.println("当前状态：制冷 26度");
    client.publish("iot/ir_out", "制冷 26度");
  }
//---------------------------------------------------------------------
//---------------------------------------------------------------------
  if (msgIN == "27"&&WhichMode == 'C') {
#if SEND_RAW
    Serial.println("红外信号发送");
    irsend.sendRaw(G_C_27, 279, 38);
#endif
    Serial.println("当前状态：制冷 27度");
    client.publish("iot/ir_out", "制冷 27度");
  }
//---------------------------------------------------------------------
//---------------------------------------------------------------------
  if (msgIN == "28"&&WhichMode == 'C') {
#if SEND_RAW
    Serial.println("红外信号发送");
    irsend.sendRaw(G_C_28, 279, 38);
#endif
    Serial.println("当前状态：制冷 28度");
    client.publish("iot/ir_out", "制冷 28度");
  }
//---------------------------------------------------------------------
//---------------------------------------------------------------------
  if (msgIN == "29"&&WhichMode == 'C') {
#if SEND_RAW
    Serial.println("红外信号发送");
    irsend.sendRaw(G_C_29, 279, 38);
#endif
    Serial.println("当前状态：制冷 29度");
    client.publish("iot/ir_out", "制冷 29度");
  }
//---------------------------------------------------------------------
//---------------------------------------------------------------------
  if (msgIN == "30"&&WhichMode == 'C') {
#if SEND_RAW
    Serial.println("红外信号发送");
    irsend.sendRaw(G_C_30, 279, 38);
#endif
    Serial.println("当前状态：制冷 30度");
    client.publish("iot/ir_out", "制冷 30度");
  }
//---------------------------------------------------------------------


  if (msgIN == "G_P_OFF") {
#if SEND_RAW
    Serial.println("红外信号发送");
    irsend.sendRaw(G_P_OFF, 279, 38);
#endif
    Serial.println("当前状态：关闭");
    client.publish("iot/ir_out", "当前状态：关闭");
  }

}

void reconnect() {
  while (!client.connected()) {
    Serial.print("Attempting MQTT connection...");
    String clientId = "ESP8266Client-";
    clientId += String(random(0xffff), HEX);
    if (client.connect(clientId.c_str())) {
      Serial.println("connected");
      client.subscribe("iot/ir_in");
    } else {
      Serial.print("failed, rc=");
      Serial.print(client.state());
      Serial.println(" try again in 5 seconds");
      delay(5000);
    }
  }
}

void setup() {
  irsend.begin();
  Serial.begin(115200);
  setup_wifi();
  client.setServer(mqtt_server, 1883);
  client.setCallback(callback);
}

void loop() {
  if (!client.connected()) {
    reconnect();
  }
  client.loop();
  long now = millis();
}
